import time

struct_time  = time.localtime()

print(time.strftime(('%Y-%m-%d %H:%M:%S'),struct_time ))
# print(time.strptime())

print (time.strptime('2018-04-17 19:58:18', '%Y-%m-%d %H:%M:%S'))

a = time.strptime('2018-04-17 19:58:18', '%Y-%m-%d %H:%M:%S')
print(a.tm_year)
print(a.tm_mon)
print(a.tm_mday)

print(time.ctime())
print(time.mktime(time.localtime()))



import datetime
print(datetime.datetime.now())
print(datetime)